<?php
class ConfirmAlbumCtl extends BaseCtl {
	public function ConfirmAlbumCtl(){
		parent::BaseCtl();
	}
	
	public function submit(){
		try {
			// delete the albums, if successful then 
			// try to delete them from the albums form and return
			$form = $this->getConfirmAlbumForm();
			$ids = $form->getIds();
			
			$service = new Service();
			$service->deleteAlbums($ids);
			
			$frm = $this->getAlbumsForm();
			$frm->deleteAlbums($ids);
			
			$this->redirect('albums.php');
		}
		catch(Exception $e){
			HtmlUtil::addError($e->getMessage());
		}
	}
	
	public function cancel(){
		try {
			$this->redirect('albums.php');
		}
		catch(Exception $e){
			HtmlUtil::addError($e->getMessage());
		}
	}
    
	public function isPostback(){
		return 'confirmalbum' == $this->getPost('pagename');
	}

    public function loadData(){
    	// the data is not about to be loaded
    	// it must be present in the list before the page is shown
    }
} 
?>